import 'package:flutter/material.dart';
import 'package:flutter_getx/view/home/logic.dart';
import 'package:flutter_getx/view/home/state.dart';
import 'package:get/get.dart';
import 'package:my_image/my_image.dart';

class HomeNav extends StatelessWidget {
  const HomeNav({super.key});
  @override
  Widget build(BuildContext context) {
    final HomeLogic logic = Get.put(HomeLogic());
    final HomeState state = Get.find<HomeLogic>().state;
    return Container(
      margin: const EdgeInsets.only(top: 10, bottom: 10),
      padding: const EdgeInsets.only(bottom: 10, top: 10),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(10),
      ),
      child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: state.navList.map((item) {
            return Expanded(
                child: Column(
              children: [
                Image.asset(
                  ImgRes.imagesPng(item['icon']),
                  width: 35,
                ),
                Text(item['title']),
              ],
            ));
          }).toList()),
    );
  }
}
